package com.erp.erp_mask.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.erp.erp_mask.pojo.TPermissions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author yang
* @description 针对表【t_permissions】的数据库操作Mapper
* @createDate 2024-05-08 16:29:38
* @Entity com.erp.erp_mask.pojo.TPermissions
*/
public interface TPermissionsMapper extends BaseMapper<TPermissions> {
    //左侧动态栏
    @Select("SELECT perm_code FROM `t_permissions` WHERE Permission_ID IN(SELECT permission_ID FROM t_role_permissions  WHERE role_id=#{roleid})")
    List<String> selectPermCodeList(@Param("roleid") Long roleid);
    //页面查询
    Page<TPermissions> search(@Param("permissionName") String name, @Param("parentId") Integer parentId,Page page);
    //权限表下拉框查询
    List<TPermissions> searchPermid();
    //顺序下拉框查询
    Integer searchSort(Integer parid);
    void addList(TPermissions tPermissions);
    @Select("SELECT permission_ID FROM t_role_permissions  WHERE role_id=#{roleid}")
    List<Long> findDefaultCheckedKeys(Long roleId);
}




